//
//  RNOLGiftCertificateViewController.m
//  RongNiuOnline
//
//  Created by apple on 2018/4/24.
//  Copyright © 2018年 rongniu. All rights reserved.
//

#import "RNOLGiftCertificateViewController.h"
#import "RNOLGiftCertificationSubViewController.h"

@interface RNOLGiftCertificateViewController ()


@end

@implementation RNOLGiftCertificateViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = kBgColor;
    self.minYPullUp = 40;
}

/**
 控制器继承 SPCoverController
 此方法返回的是标题栏 标题
 */
- (NSString *)titleForIndex:(NSInteger)index
{
    return @[@"可用礼券",@"已用礼券",@"过期礼券"][index];
}

- (CGFloat)tabWidthForIndex:(NSInteger)index{
    return KWIDTH/3.0;
}

/**
 下面联动的ChildController控制器的数量
 */
- (NSInteger)numberOfControllers
{
    return 3;
}

- (CoverScrollStyle)preferCoverStyle{
    return CoverScrollStyleTop;
}

- (CGFloat)preferTabY{
    return 40;
}

/**
 下面联动的ChildController控制器
 */
- (UIViewController *)controllerAtIndex:(NSInteger)index
{
    RNOLGiftCertificationSubViewController *coverController = [[RNOLGiftCertificationSubViewController alloc] init];
    coverController.view.frame = [self preferPageFrame];
    RNOLGiftCertificationType type = (RNOLGiftCertificationType)(1 - index);
    coverController.type = type;
    return coverController;
}

//页面切换已在SPTabcontroller 实现
- (void)didPressTabForIndex:(NSInteger)index{
    [super didPressTabForIndex: index];
    
}

//横向滑动
- (void)scrollViewContentOffsetWithRatio:(CGFloat)ratio draging:(BOOL)draging{
    [super scrollViewContentOffsetWithRatio:ratio draging:draging];
    
}

@end
